import { useLocation, useParams, useNavigate } from "react-router-dom";
// useParams 动态路由 useRoutes 配置路由
function withRouter(Home: any) {
  const Hoc = (props: any) => {
    return (
      <Home
        {...props}
        location={useLocation()}
        params={useParams()}
        navigate={useNavigate()}
      />
    );
  };
  return Hoc;
}
export default withRouter;
